package com.mall.mymall.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.mall.mymall.enums.Roles;
import org.springframework.security.core.userdetails.User;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * <p>
 *
 * </p>
 *
 * @author 十里坡
 * @since 2025-03-06
 */
public class Administrators implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "admin_id", type = IdType.AUTO)
    private Integer adminId;

    private String username;

    private String nickname;

    private String password;

    @TableField(value = "role_id")
    private Integer roleId;

    @TableField(value = "avatar_url")
    private String avatarUrl;


    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public Administrators() {

    }

    public Administrators(Integer adminId, String username, String nickname, String password, Integer roleId, String avatarUrl) {
        this.adminId = adminId;
        this.username = username;
        this.nickname = nickname;
        this.password = password;
        this.roleId = roleId;
        this.avatarUrl = avatarUrl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Administrators that = (Administrators) o;
        return Objects.equals(adminId, that.adminId) && Objects.equals(username, that.username) && Objects.equals(nickname, that.nickname) && Objects.equals(password, that.password) && Objects.equals(roleId, that.roleId) && Objects.equals(avatarUrl, that.avatarUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(adminId, username, nickname, password, roleId, avatarUrl);
    }
}
